//
//  HappyView.m
//  UI5_UIControl
//
//  Created by dllo on 15/11/12.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "HappyView.h"

@implementation HappyView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubviews];
    }
    return self;
}


- (void)createSubviews
{
    self.backgroundColor = [UIColor lightGrayColor];
    
    NSMutableArray  *imageArr = [NSMutableArray array];
    
    for (NSInteger i = 1; i < 18; i++) {
        NSString *fileName = [NSString stringWithFormat:@"happy_%04ld.png", i];
        UIImage *image = [UIImage imageNamed:fileName];
        [imageArr addObject:image];
        
    }
    
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:self.frame];
    
    imageV.animationImages = imageArr;
    
    
    [self addSubview:imageV];
    
    [imageV startAnimating];
    
    [imageV release];
    
    
}



@end
